﻿@using CommandLib
@using FindArtInfo.Models;
@using Resources
@model PriceSearchResultModel
@{
    ViewBag.Title = "Search";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<table border="0" width="100%" id="table5" cellspacing="0" cellpadding="0">
    <tr>
        <td align="left" valign="top">
            &nbsp;
        </td>
    </tr>    
    <tr>
        <td align="left" valign="top">
            <!--ket qua search"-->
            <h1 class="underline">@string.Format(Multi.PriceSearchResultTitle, Model.PriceSearchResultKeyWord)</h1>
            <h2>               
                @string.Format(Multi.PriceSearchResultMessageMatchFound, Utils.FomatNumber(Model.TotalRecord.ToString()), Utils.FomatNumber(Model.PageIndex.ToString()), Utils.FomatNumber(Model.TotalPage.ToString()), Utils.FomatNumber(Model.PageSize.ToString()))
            </h2>
            <table border="0" cellspacing="0" cellpadding="0" width="100%">
                <tr>
                    <td width="72" height="18" bgcolor="#525E54"> &nbsp;</td>
                    <td bgcolor="#525E54" height="18" width="93">                        
                        @Html.ActionLink(Multi.PriceSearchResultTblHeaderAuctionTime, "Search", "Prices", new {priceTitle = Model.PriceSearchResultKeyWord, order = 1}, new { @style = "color:#FFFFFF;font-weight: bolder", @title = Multi.PriceSearchOrderByDate})
                    </td>
                    <td width="333" height="18" bgcolor="#525E54">                        
                        @Html.ActionLink(Multi.PriceSearchResultTblHeaderItemName, "Search", "Prices", new {priceTitle = Model.PriceSearchResultKeyWord, order = 2}, new { @style = "color:#FFFFFF;font-weight: bolder", @title = Multi.PriceSearchOrderByTitle})
                    </td>
                    <td width="162" height="18" bgcolor="#525E54">                        
                        @Html.ActionLink(Multi.PriceSearchResultTblHeaderSize, "Search", "Prices", new {priceTitle = Model.PriceSearchResultKeyWord, order = 3}, new { @style = "color:#FFFFFF;font-weight: bolder", @title = Multi.PriceSearchOrderBySize})
                    </td>
                    <td width="88" height="18" align="right" bgcolor="#525E54">                        
                        @Html.ActionLink(Multi.PriceSearchResultTblHeaderPrice, "Search", "Prices", new {priceTitle = Model.PriceSearchResultKeyWord, order = 4}, new { @style = "color:#FFFFFF;font-weight: bolder", @title = Multi.PriceSearchOrderByPrice})
                    </td>
                </tr>
                <!-- begin -->
                @foreach(var item in Model.ListPrice)
                {
                    <tr onmouseover="this.style.backgroundColor='#EEEEEE'" onmouseout="this.style.backgroundColor='#FFFFFF'">
                        <td height="24">
                            <img height="20" width="20" class="hand" alt="@string.Format(Multi.PriceSearchResultTblContentHammerPrices, item.ItemName)" src="/Content/Images/icon_hammer.gif" border="0"/>
                            @if(item.CountArtWork > 0)
                            {
                                <img height="20" width="20" class="hand" alt="@string.Format(Multi.PriceSearchResultTblContentHammerArtWok, item.ItemName)" src="/Content/Images/icon_photo.gif" border="0" />
                            }
                        </td>
                        <td>
                            @item.AuctionTime.ToString("MM-dd-yyyy")
                        </td>
                        <td>
                            <span  class='linkgoogle' >                                
                                @Html.ActionLink(HttpUtility.HtmlDecode(item.ItemName), "Detail", "Prices", new { priceId = item.ID})
                            </span>
                        </td>
                        <td>
                            @{
                                decimal H = item.Height == null ? 0 : item.Height;
                                decimal W = item.Width == null ? 0 : item.Width;
                                decimal D = item.Depth == null ? 0 : item.Depth;
                                
                                if (D == 0)
                                {
                                    <span>@((H + " x " + W + " in"))</span>                                        
                                }
                                else
                                {
                                    <span>@((H + " x " + W + " x " + D + " in"))</span>
                                }
                                
                            }                                
                        </td>
                        <td align='right'>
                            @(item.PriceInUS > 0 ? Utils.FomatNumber(item.PriceInUS.ToString()) + " USD" : "Unsold")                               
                        </td>
                    </tr>
                }
                <tr align="center" height="35px">
                    <td colspan="5">
                        @Html.Partial("_PartialPaging", new PagingModel { PageIndex = Model.PageIndex, PageSize = Model.PageSize, TotalPage = Model.TotalPage, TotalRecord = Model.TotalRecord, Url = Model.Url, })
                    </td>
                </tr>                
            </table>
        </td>
    </tr>
    <tr>
        <td>
            <table width="100%" cellspacing="0" cellpadding="2" border="0" id="table3">
                <tbody>
                    <tr>
                        <td width="50%" align="left">
                            <p align="left">
                                @Html.ActionLink(Multi.PriceSearchResultBack, null, null, new { onclick = "history.back();"})
                            </p>
                        </td>
                        <td width="50%" align="right">
                            <p align="right">
                                @Html.ActionLink(Multi.PriceSearchResultNewSearch, "AdvancedSearch", "Home")
                            </p>
                        </td>
                    </tr>
                </tbody>
            </table>
        </td>
    </tr>
    <tr>
        <td align="left" valign="top">&nbsp;</td>
    </tr>
</table>
